package com.leet.code.lcof;

public class Code10_1 {
    public static void main(String[] args) {
        System.out.println(fib(95));

    }

    public static int fib(int n) {
        int a0 = 0;
        int a1 = 1;
        if (n == 0) {
            return  a0;
        }
        if (n == 1) {
            return  a1;
        }

        int an = 0;
        for (int i = 2; i <= n; i++) {
            an = (a1 + a0) % 1000000007;
            a0 = a1 ;
            a1 = an ;
        }


        return an;
    }
}
